using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GameServer.Concurrent
{
    public class ConcurrentInt
    {
        private int value;
        public ConcurrentInt(int val)
        {
            this.value = val;
        }

        public int Add_Get()
        {
            lock(this)
            {
                ++value;
                return value;
            }
        }

        public int Reduce_Get()
        {
            lock (this)
            {
                --value;
                return value;
            }
        }
        public int Get()
        {
            return value;
        }
    }
}
